#pragma once
#ifndef _KLAS_POLYGON_HPP_
#define _KLAS_POLYGON_HPP_

#include "../Platform.hpp"
#include "../graphics/Renderable.hpp"
#include "../graphics/ColoredVector2.hpp"
#include "../graphics/PrimitiveTypes.hpp"

#include <vector>
using std::vector;

namespace klas
{
  namespace graphics
  {

    //! A basic shape (usually a polygon), which includes circles, rectangles, triangles, and lines.  Has different rendering methods.
    class KLAS_API Primitive: public Renderable
    {
    public:
      

      //! Ctor.  Builds a rectangle.
      Primitive();

      

      //! Changes the color of all points.
      /*! \param col The new color for the primitive.
          \return Success or failure.  Should always return true. */
      void setColor(const Color& col);

      //! Gets the color of the primitive
      Color getColor() const;

      //! Changes the shape of the object.
      /*! \param type The type of shape.  Params are RenderingCore:: { CIRCLE, TRIANGLE, RECTANGLE, LINE }
          \param angle If you have a triangle shape, then angle is the meausre of an internal angle. */
      void setShape(primitiveTypes::ePrimitiveType type, double angle=90);

      //! Gets the shape of the object.
      primitiveTypes::sPrimitiveType getShape() const;

      //! Changes how the polygon is rendered.
      /*! \param mode Options are primitiveTypes:: { FILLED (default), LINES, POINT } */
      void setPolygonMode(primitiveTypes::ePolygonMode mode);

      //! Gets the mode in which the polygon is rendered.
      primitiveTypes::ePolygonMode getPolygonMode() const;


    private:

      virtual void renderElement(RenderingCore* core, const math::Vector2d& origin);
      
      primitiveTypes::sPrimitiveType m_primitiveType;
      Color m_color;
  
      

    };
  }
}

#endif